﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace IndexedList
{
    public interface IIndexedList<T> : IList<T> where T : new()
    {
        bool IgnoreNulls
        {
            get;
            set;
        }

        void AddIndex(IListIndex<T> index);
        //void AddIndex(Expression<Func<T, object>> keySelector, string name = "");
        //void AddUniqueIndex(Expression<Func<T, object>> keySelector, string name = "");

        void Clear();
        void Add(T item);
        void Remove(T item);

        IEnumerable<T> Find(Expression<Func<T, bool>> expression);
        T FindSingle(Expression<Func<T, bool>> expression);

        IEnumerable<T> Find(params object[] values);
        T FindSingle(params object[] values);

        IEnumerable<T> FindUsingIndex(string indexName, T item);
        T FindSingleUsingIndex(string indexName, T item);

        IEnumerable<T> FindUsingIndex(string indexName, params object[] values);
        T FindSingleUsingIndex(string indexName, params object[] values);

        //IEnumerable<T> Where(Expression<Func<T, bool>> expression);
        //IEnumerable<T> Where<T>(Func<T, bool> predicate);
    }

    
}
